# coding=utf-8

import urllib
import web

import settings
import utils

render = settings.RENDER

class Duanwu(object):
    """
    端午节的祝福页
    """
    def GET(self, name = None):
        return self.render(name)

    def POST(self, name = None):
        name = name or '寻宝图'
        short_url = utils.short_url('http://%s/holiday/duanwu/%s' % (settings.CONFIG.DOMAIN, urllib.quote(name.encode('utf-8'))))
        return short_url

    def render(self, name):
        return render.holiday.duanwu.index(name or '寻宝图')
